# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=procyon
pkgver=0.6
pkgrel=1
pkgdesc='A suite of Java metaprogramming tools focused on code generation and analysis.'
arch=('any')
groups=('blackarch' 'blackarch-decompiler' 'blackarch-code-audit')
url='https://github.com/mstrobel/procyon'
license=('custom:unknown')
depends=('java-environment')
source=("https://github.com/mstrobel/procyon/releases/download/$pkgver-prerelease/$pkgname-decompiler-$pkgver-prerelease.jar")
sha512sums=('a976e20075d1869880a44619ab6b41197e2676cfa034566d594a52d3b785de4fe42bbf1717654228f71cbd56411a7625e8b59e009349601c809a942d25433e4c')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 755 "$pkgname-decompiler-$pkgver-prerelease.jar" \
    "$pkgdir/usr/share/$pkgname/$pkgname-decompiler-$pkgver.jar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/$pkgname-decompiler-$pkgver.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

